<template>
  <div ref="chartRef" style="width: 100%; height: 400px;"></div>
</template>

<script setup lang="ts">
import * as echarts from 'echarts'
import { onMounted, ref } from 'vue'

const chartRef = ref()
onMounted(() => {
  const chart = echarts.init(chartRef.value)
  chart.setOption({
    title: { text: '销量图' },
    xAxis: { data: ['苹果', '香蕉', '梨', '橙子'] },
    yAxis: {},
    series: [{ type: 'bar', data: [5, 20, 36, 10] }]
  })
})
</script>
